﻿
// mfc_opencvDlg.h: 头文件
//

#pragma once
#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui_c.h"

// 面部识别
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp" 
#include "opencv2/imgproc/imgproc.hpp"

using namespace cv;

// CmfcopencvDlg 对话框
class CmfcopencvDlg : public CDialogEx
{
// 构造
public:
	CmfcopencvDlg(CWnd* pParent = nullptr);	// 标准构造函数

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_MFC_OPENCV_DIALOG };
#endif

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持


// 实现
protected:
	HICON m_hIcon;

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	CMenu mMenu;
	Mat srcImage;
	CString pathName;

	// 面部识别
	String face_cascade_name;
	String eyes_cascade_name;
	CascadeClassifier face_cascade;
	CascadeClassifier eyes_cascade;
	VideoCapture capture;
	bool stopCapture;


	virtual BOOL PreTranslateMessage(MSG* pMsg);
	afx_msg void OnMenuItemOriginal();
	afx_msg void OnMenuItemMeanFilter();
	afx_msg void OnMenuItemGray();
	afx_msg void OnMenuItemCanny();
	afx_msg void OnMenuItemOpen();
	afx_msg void OnMenuItemExit();
	afx_msg void OnDestroy();

	afx_msg void OnMenuItemSave();
	afx_msg void OnMenuItemCameraOpen();
	void detectAndDisplay(Mat frame);
	void ShowFullScreen();
	afx_msg void OnMenuItemOpenOperation();
	afx_msg void OnMenuItemCloseOperation();
	afx_msg void OnMenuItemBinaryzation();
};
